package com.berchen.castans;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstansUtils implements InitializingBean {
    @Value("${aliyun.sms.regionId")
    private String regionId;
    @Value("${aliyun.sms.accessKeyId}")
    private String accessKeyId;
    @Value("${aliyun.sms.secret}")
    private String secret;

    @Value("${oss.endpoint}")
    private String oss_endpoint;
    @Value("${oss.accesskeyid}")
    private String oss_accesskeyId;
    @Value("${oss.accesskeysecret}")
    private String oss_accesskeySecret;
    @Value("${oss.buketname}")
    private String oss_buketname;


    // 短信
    public static String REGION_Id;
    public static String ACCESS_KEY_ID;
    public static String SECRECT;

    // oss
    public static String OSS_ENDPOINT;
    public static String OSS_ACCESSKEYID;
    public static String OSS_ACCESSKEYSECRET;
    public static String OSS_BUKETNAME;


    @Override
    public void afterPropertiesSet() throws Exception {

        REGION_Id = regionId;
        ACCESS_KEY_ID = accessKeyId;
        SECRECT = secret;
        OSS_ENDPOINT = oss_endpoint;
        OSS_ACCESSKEYID = oss_accesskeyId;
        OSS_ACCESSKEYSECRET = oss_accesskeySecret;
        OSS_BUKETNAME = oss_buketname;

    }
}
